<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%request.setCharacterEncoding("UTF-8"); %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>验证</title>
</head>
<body>

<%-- 原用户名：<%=username %>    
原密码：<%=pws %> 
登录名：<%=loginame %>   
登录密码：<%=loginpwd %>
    系统产生的认证码为： <%= rand %><br>
    您输入的认证码为： <%= input %><br>
    <br> --%>
   <%
     String username=(String)session.getAttribute("users");
     String pws=(String)session.getAttribute("pws");
     String rand = (String)session.getAttribute("rand");
     String input = request.getParameter("yanz");
     String loginame=request.getParameter("name");
     String loginpwd=request.getParameter("password");
     session.setAttribute("usere", loginame);		
     session.setAttribute("pwse", loginpwd);
    
    %>
<%if(loginame.equals(username) && loginpwd.equals(pws) && rand.equals(input) ){%>
	<font color=red>"进入主界面"</font>
	<% response.sendRedirect("main.jsp"); %>
  <% }%>
 <% if(loginame.equals(username) && loginpwd.equals(pws) && rand!=input){%>
	<font color=red> "验证码不正确，请重新输入"</font>
	  
  <%}%>
 <%  if(loginame!=username && loginpwd.equals(pws) && rand.equals(input)){%>
	<font color=red>"登录账号不正确，请重新输入"</font>
	  
 <% }	%>  
  <% if(loginame.equals(username) && loginpwd.toString()!=pws.toString() && !rand.equals(input)){%>
	<font color=red>"密码不正确，请重新输入"</font>
	 
 <% }%>
  
    
    
    
  
</body>
</html>